package com.ming.mq.topic;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class TopicMQSender {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send1(Object msg){
        log.info("topic-send1:{}",msg);
        rabbitTemplate.convertAndSend(TopicConfig.TOPICEXCHANGE,"queue.one.msg",msg);
    }

    public void send2(Object msg){
        log.info("topic-send2:{}",msg);
        rabbitTemplate.convertAndSend(TopicConfig.TOPICEXCHANGE,"msg.queue.one.msg",msg);
    }
}
